package cn.itcast.controller.system;

import cn.itcast.controller.BaseController;
import cn.itcast.domain.system.Dept;
import cn.itcast.service.system.DeptService;
import cn.itcast.service.system.SysLogService;
import com.github.pagehelper.PageInfo;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.UUID;

@Controller
@RequestMapping("/system/log")
public class SysLogController extends BaseController {


    @Autowired
    private SysLogService sysLogService;

    @RequestMapping(value = "/list",name = "分页展示日志数据列表展示") // page代表当前的页码  page=2
    public String findAll(@RequestParam(value = "page",defaultValue = "1") Integer pageNum , @RequestParam(defaultValue = "10")Integer pageSize){

        PageInfo pageInfo = sysLogService.findPage(getCompanyId(),pageNum,pageSize);
        request.setAttribute("page",pageInfo); //这里的page名称不能改，因为页面要的就是page这个名称
        return "system/log/log-list";
    }


}
